<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* [v-cloak] {
            display: none;
        } */
    </style>
</head>

<body>
    <!-- mvvm view层 -->

    <!-- <div id="app" v-cloak>
        {{msg}} 
    </div> -->
    <!-- 没有闪烁问题 -->
    <div id="app">
        <div v-html="msg"></div>
        <!-- 显示h1的msg -->
        <div v-html="msg2"></div>
        <!-- 显示<h1>Vue</h1> -->
        <div v-text="msg2"></div>
        <!-- 显示{{msg2}} -->
        <div v-pre>{{msg2}}</div>
        <p v-once>{{msg}}</p>
        <div>
            <input type="text" v-model="uname">
            <!-- v-bind:属性   简写：属性  语法糖 -->
            <!-- <input type="text" v-bind:value="uname"> -->
            <input type="text" :value="uname">
        </div>
    </div>
    <!-- 导入vue -->
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        // 相当于viewmodel层
        let vm = new Vue({
            el: '#app',
            // model层
            data() {
                return {
                    msg: 'hello Vue',
                    msg2: '<h1>Vue</h1>',
                    uname:''
                }
            }
        });
        vm.msg = 'hello world'
    </script>
</body>

</html>